<template>
	<view class="flex-col page">
		<view class="flex-col flex-auto group">
			<view class="flex-col">
				<view class="flex-row justify-between items-center section_3" @click="toAccount" v-if="shop_id!=''">
					<text class="font_2">账号安全</text>
					<image class="image_6" src="" />
				</view>
				<view class="flex-row justify-between items-center section_3" @click="toYinsi(1)">
					<text class="font_2">用户协议</text>
					<image class="image_6" src="" />
				</view>
				<view class="flex-row justify-between items-center section_3" @click="toYinsi(2)">
					<text class="font_2">隐私政策</text>
					<image class="image_6" src="" />
				</view>
			</view>
			<view class="flex-col justify-start items-center button text-wrapper" @click="toNotSign" v-if="shop_id!=''"><text class="text_4">退出登录</text></view>
		</view>
	</view>
</template>

<script setup>
	import {
		onShow
	} from "@dcloudio/uni-app";
	import {
		onMounted,
		ref,
		reactive
	} from "vue"
	let shop_id = ref('')
	
	onShow(() => {
		if( uni.getStorageSync('shop_id')){
			shop_id.value= uni.getStorageSync('shop_id')
			// getDate()
		}else{
			shop_id.value=''
		}
		
	})
	const toNotSign=()=>{
		uni.removeStorageSync('shop_id')
		uni.showToast({
			title:'退出成功！',
			icon:'none'
		})
		setTimeout(()=>{
			uni.navigateBack()
		},1500)
	}
	const toLogin = () => {
		uni.navigateTo({
			url:'/pages/login/login'
		})
	}
	
	const toDetail = () => {
		uni.navigateTo({
			url:'/pages/mineDetail/mineDetail'
		})
	}
	const toAccount = () => {
		uni.navigateTo({
			url:'/pages/account/account'
		})
	}
	
	const toHelp = () => {
		uni.navigateTo({
			url:'/pages/help/help'
		})
	}
	const toAbout = () => {
		uni.navigateTo({
			url:'/pages/aboutUs/aboutUs'
		})
	}
	const toYinsi = (num) => {
		uni.navigateTo({
			url:'/pages/yonghuxieyi/yonghuxieyi?type='+num
		})
	}
	const toFeedback = () => {
		uni.navigateTo({
			url:'/pages/feedback/feedback'
		})
	}
</script>

<style scoped lang="scss">
	.page {
		background-color: #f8f8f8;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100vh;

		.group {
			padding-bottom: 56rpx;
			overflow-y: auto;

			.section_3 {
				padding: 38rpx 30rpx;
				background-color: #ffffff;

				.font_2 {
					font-size: 28rpx;
					font-family: PingFangSC;
					line-height: 27rpx;
					color: #333333;
				}

				.image_6 {
					width: 9rpx;
					height: 18rpx;
				}
			}

			.button {
				align-self: center;
				// margin-top: 976rpx;
				position: fixed;
				bottom: 40rpx;
				left: 60rpx;

				.text_4 {
					color: #ffffff;
					font-size: 32rpx;
					font-family: PingFangSC;
					line-height: 31rpx;
				}
			}

			.text-wrapper {
				padding: 34rpx 0;
				background-color: #ff3333;
				border-radius: 24rpx;
				width: 630rpx;
			}
		}
	}
</style>